package com.gopay.common.cps.dao.bank.impl;

import java.io.Serializable;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.type.NullableType;
import org.springframework.stereotype.Repository;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.cps.dao.bank.BisAdPayDAO;
import com.gopay.common.domain.bis.BisAdPayConfig;
import com.gopay.common.domain.bis.BisDebitExPayConfig;

/** 
 * @ClassName: BisAdPayDAOImpl 
 * @author w_jiqing 
 * @date 2017年1月18日 下午3:19:26  
 */ 
@Repository("bisAdPayDAO")
public class BisAdPayDAOImpl extends BaseDAOImpl<BisAdPayConfig, Serializable> implements BisAdPayDAO {

    @Override
    public BisAdPayConfig getBisAdPayByBankCodeAndInterfaceCode(String bankCode, String interfaceCode) {
        Map<String,Object> params = new HashMap<String,Object>();
        params.put("bankCode", bankCode);
        params.put("chCode", interfaceCode);
        List<BisAdPayConfig> l = super.findByHql("from BisAdPayConfig where del=0 and bankCode=:bankCode and chCode =:chCode ", params);
        return l.size() > 0 ? l.get(0) : null;
    }

    @Override
    public List<BisAdPayConfig> getBisAdPayConfigByBankCode(String bankCode) {
        Map<String,Object> params = new HashMap<String,Object>();
        params.put("bankCode", bankCode);
        return super.findByHql("from BisAdPayConfig where del=0 and bankCode=:bankCode and enable=1 ", params);
    }

    
}
